//C07:Stack3.cpp
// Using a vector as a stack: modified Stack1.cpp.
#include <fstream>
#include <iostream>
#include <string>
#include <vector>
using namespace std;

int main(void)
{
    ifstream in("Stack3.cpp");
    vector<string> textlines;
    string line;
    while (getline(in, line))
    {
        textlines.push_back(line + "\n");
    }

    while (!textlines.empty())
    {
        cout << textlines.back();
        textlines.pop_back();
    }
}